<?php
	/*
		Autor: lesthack
		url: http://code.inocorp.org
		script: js-out
		Description: Generador de javascript
	*/
	
	function alert($message=""){
		print "alert('$message');";
	}
	
	function createElement($idparent, $tag, $id, $name, $text, $class=""){
		
		print "
			var element = document.createElement('$tag');
				element.className = '$class';
				element.id = '$id';
				element.name = '$name';
		";
		
		
		if($text){
			print "
				element.appendChild(document.createTextNode('$text'));
			";
		}
		
		
		print "
			var parent = document.getElementById('$idparent');
				parent.appendChild(element);
		";
		
	}
	
	function appendChild($idparent, $idchild){
		print "
			var parentelement = document.getElementById('$idparent');
			var childelement = document.getElementById('$idchild');
				parentelement.appendChild(childelement);
		";
	}
?>
